package org.iabako.shared.iservice.business;

import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
import org.iabako.shared.entity.business.Expense;
import org.iabako.shared.entity.business.Installment;
import org.iabako.shared.exception.IabakoActionForbiddenException;
import org.iabako.shared.exception.IabakoUniqueConstraintException;
import org.iabako.shared.iservice.generic.*;
import org.iabako.shared.querydefinition.dto.QueryDefinitionDTO;

import java.util.Date;
import java.util.List;

/**
 * Created by jose on 04/11/14.
 */
@RemoteServiceRelativePath("iabakoServices/expenseService")
public interface ExpenseService extends SearchService, SuggestService, CRUDService, BusinessEntityService, TaxService, RemoteService {

    Expense save(Expense expense, List<Installment> customInstallmentsDefinition) throws IabakoActionForbiddenException, IabakoUniqueConstraintException;

    List<String> getAllCustomCategories();

    Expense getNewExpense(int index, Expense expenseReference, Date newDate, Double amount);

    Expense stopUndefinedExpensesCreation(Expense expense) throws IabakoActionForbiddenException;

    Double getTotal(QueryDefinitionDTO queryDefinitionDTO);
}
